package com.atguigu.springcloud.controller;

import com.atguigu.springcloud.service.PaymentService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@Slf4j
public class PaymentController {

    @Resource
    private PaymentService payment;

    @GetMapping("/payment/hystrix/{id}")
    public String getOk(@PathVariable Integer id){
        return payment.getOk(id);
    }
    @GetMapping("/payment/hystrixerror/{id}")
    public String hystrixerror(@PathVariable Integer id){
        return payment.getOk5s(id);
    }

  @GetMapping("/payment/circuitbreaker/{id}")
    public String getCircuitBreaker(@PathVariable Integer id){
        return payment.getCircuitBreaker(id);
    }


}
